home *** CD-ROM | disk | FTP | other *** search
- Path: anvil.ugrad.cs.ubc.ca!not-for-mail
- From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
- Newsgroups: comp.lang.c++,comp.lang.c
- Subject: Re: Performance: C vs. C++
- Date: 27 Feb 1996 10:18:16 -0800
- Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
- Message-ID: <4gvht8INNkbu@anvil.ugrad.cs.ubc.ca>
- References: <30F6BAAC.12B5@iastate.edu> <4fvr7k$a3l@stc06.ctd.ornl.gov> <4gqdo6INNsqe@keats.ugrad.cs.ubc.ca> <4guu1v$ie1@solutions.solon.com>
- NNTP-Posting-Host: anvil.ugrad.cs.ubc.ca
-
- In article <4guu1v$ie1@solutions.solon.com>,
- Peter Seebach <seebs@solutions.solon.com> wrote:
- >In article <4gqdo6INNsqe@keats.ugrad.cs.ubc.ca>,
- >Kazimir Kylheku <c2a192@ugrad.cs.ubc.ca> wrote:
- >>Boy, with all this obfuscation, you can almost forget that a pointer is just a
- >>simple machine address!
- >
- >No, it's a machine address or similar tag along with a knowledge of what kind
- >of thing it points to. Implementations exist where the conversion from a
- >char * to a long * is a right-shift by 2. Although it's not complete, I
-
- Of course. But point to one implementation that will use such different
- representations between pointers to two different data structure types (not
- atomic types like char or long).
-
- Having the type checking there is great, but too much abstraction is just,
- well, too much!
-
- >have a draft for an implementation where
- > main() {
- > int i, *ip = &i;
- > }
- >leaves ip looking something like "pint, 0".
- >
- >(0 is not the null pointer internally in this implementation; it's used for
- >the first object of a type.)
- >(i is internally marked as being an int as well, so &i looks like "pint, 0",
- >and the assignment is legal. Assigning from most other pointer types without
- >the required cast would generate a run-time fault. ;))
-
- But this kind of low level explanation is far removed from the original posting
- about lofty new pointer semantics.
- --
-
-